package him.action.board;

import him.action.Action;
import him.action.ActionForward;
import him.dto.bbs.BoardRepDto;
import him.dto.login.LoginDTO;
import him.serviceimple.BoardRepServiceImp;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



public class DetailBoardAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		ActionForward forward=new ActionForward();
		BoardRepServiceImp service=BoardRepServiceImp.getInstance();
		
		String sseq=request.getParameter("seq");
		int seq=Integer.parseInt(sseq.trim());
		BoardRepDto rdto=service.getBoard(seq);
		LoginDTO dto =(LoginDTO) request.getSession().getAttribute("login");
		System.out.println(dto);
		request.setAttribute("dto", dto);
		
		request.setAttribute("board",rdto);
		forward.setUrl("boarddetail");
		
		
		return forward;
	}

}
